package com.fzj.example.design.memennto;

import com.sun.tools.corba.se.idl.constExpr.Or;

public class Testy {
    public static void main(String[] args) {
        Originator originator=new Originator();
        Caretaker caretaker=new Caretaker();
        originator.setState("0");
        String state = originator.getState();
        System.out.println("init state" + state);
        caretaker.setMemento(originator.createMemento());
        originator.setState("1");
        System.out.println("new state"+originator.getState());
        originator.restoreMemento(caretaker.getMemento());
        System.out.println("restore state"+originator.getState());
    }
}
